package com.ykzb.page.controller;

import com.ykzb.constants.UrlConstants;
import com.ykzb.page.service.IIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/")
public class IndexController {

	@Autowired
	private IIndexService indexService;

	/**
	 * 网站主页
	 * @return
	 */
	@RequestMapping(value = UrlConstants.INDEX_PAGE)
	public ModelAndView index(HttpServletRequest request)
	{
		ModelMap model = indexService.toIndex(request);
		return new ModelAndView("index",model);
	}


}
